<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4" >

<!--封装公共模块-->

<!--封装头部-->
<head th:fragment="head(title)">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title th:text="${title}"></title>
    <!--  站点图标-->
    <link rel="icon" th:href="@{/image/urlImg/aa2pc-cu0e6-001.ico}" type="image/ico">
    <link th:href="@{/css/admin/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/css/admin/css/materialdesignicons.min.css}" rel="stylesheet">
    <link th:href="@{/css/admin/css/style.min.css}" rel="stylesheet">
    <link th:href="@{/css/font-img.css}" rel="stylesheet">
    <!--    导入layui组件，优秀的弹窗框架-->
    <link rel="stylesheet" th:href="@{/plugins/layui-v2.6.8/layui/css/layui.css}">
<!--    <link rel="shortcut icon" th:href="@{/image/urlImg/aa2pc-cu0e6-001.ico}" type="image/x-icon">-->

</head>

<!--导入js-->
<div th:fragment="javascript">
    <script type="text/javascript" th:src="@{/js/admin/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/admin/bootstrap.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/admin/perfect-scrollbar.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/admin/main.min.js}"></script>
    <!--图表插件-->
    <script type="text/javascript" th:src="@{/js/admin/Chart.js}"></script>
    <!--    导入layui组件，优秀的弹窗框架-->
    <script th:src="@{/plugins/layui-v2.6.8/layui/layui.js}"></script>
</div>

<!--左侧导航-->
<aside th:fragment="leftNav" class="lyear-layout-sidebar">

    <!-- logo -->
    <div id="logo" class="sidebar-header">
        <a href="/admin"><img th:src="@{/image/logo.jpg}" title="newIdeas" alt="newIdeas" /></a>
    </div>
    <div class="lyear-layout-sidebar-scroll">
        <nav class="sidebar-main">
            <ul class="nav nav-drawer">
                <li class="nav-item active"> <a href="/admin"><i class="mdi mdi-home"></i> 后台首页</a> </li>
                <li class="nav-item nav-item-has-subnav">
                    <a href="javascript:void(0)"><i class="iconfont icon-houtaiguanli-fabuwenzhang" style="font-weight: 700"></i> 文章</a>
                    <ul class="nav nav-subnav">
                        <li> <a href="/admin/newArticle">写文章</a> </li>
                        <li> <a href="javascript:;" onclick="openArticle()">所有文章</a> </li>

                        <script type="text/javascript">
                            //选择略缩图
                            function openArticle(){
                                layer.open({
                                    type : 2,
                                    title : '所有文章',
                                    anim : 2,
                                    area : [ '90%', '90%' ],
                                    maxmin : true,
                                    shadeClose: true,
                                    content : "/admin/allArticle"  //通过请求打开附件视图
                                });
                            }
                        </script>
                        <li> <a href="javascript:;" onclick="openArticleRelease()">已发布</a> </li>

                        <script type="text/javascript">
                            //选择略缩图
                            function openArticleRelease(){
                                layer.open({
                                    type : 2,
                                    title : '已发布',
                                    anim : 2,
                                    area : [ '90%', '90%' ],
                                    maxmin : true,
                                    shadeClose: true,
                                    content : "/admin/allArticleRelease"  //通过请求打开附件视图
                                });
                            }
                        </script>
                        <li> <a href="javascript:;" onclick="openArticleDraft()">草稿箱</a> </li>

                        <script type="text/javascript">
                            //草稿箱
                            function openArticleDraft(){
                                layer.open({
                                    type : 2,
                                    title : '草稿箱',
                                    anim : 2,
                                    area : [ '90%', '90%' ],
                                    maxmin : true,
                                    shadeClose: true,
                                    content : "/admin/allArticleDraft"  //通过请求打开附件视图
                                });
                            }
                        </script>
                    </ul>
                </li>
                <li class="nav-item nav-item-has-subnav">
                    <a href="javascript:void(0)"><i class="iconfont icon-huaban50fuben6"></i> 投稿</a>
                    <ul class="nav nav-subnav">
                        <li> <a href="javascript:;" onclick="getManuscript(0)">新提交</a> </li>
                        <li> <a href="javascript:;" onclick="getManuscript(1)">通过</a> </li>
                        <li> <a href="javascript:;" onclick="getManuscript(2)">未通过</a> </li>
                        <script type="text/javascript">
                            //投稿
                            function getManuscript(status){
                                if (status==0){
                                    layer.open({
                                        type : 2,
                                        title : '新提交',
                                        anim : 2,
                                        area : [ '90%', '90%' ],
                                        maxmin : true,
                                        shadeClose: true,
                                        content : "/admin/getManuscript/"+status
                                    });
                                }else if (status==1){
                                    layer.open({
                                        type : 2,
                                        title : '通过',
                                        anim : 2,
                                        area : [ '90%', '90%' ],
                                        maxmin : true,
                                        shadeClose: true,
                                        content : "/admin/getManuscript/"+status
                                    });
                                }else {
                                    layer.open({
                                        type : 2,
                                        title : '未通过',
                                        anim : 2,
                                        area : [ '90%', '90%' ],
                                        maxmin : true,
                                        shadeClose: true,
                                        content : "/admin/getManuscript/"+status
                                    });
                                }

                            }
                        </script>
                    </ul>
                </li>
                <li class="nav-item nav-item-has-subnav">
                    <a href="javascript:void(0)"><i class="iconfont icon-yonghuguanli"></i> 用户管理</a>
                    <ul class="nav nav-subnav">
                        <li> <a href="javascript:;" onclick="getUserList()">用户列表</a> </li>
                        <script type="text/javascript">
                            //用户列表
                            function getUserList(){
                                layer.open({
                                    type : 2,
                                    title : '用户列表',
                                    anim : 2,
                                    area : [ '90%', '90%' ],
                                    maxmin : true,
                                    shadeClose: true,
                                    content : "/admin/userList"  //通过请求打开附件视图
                                });
                            }
                        </script>
                    </ul>
                </li>
                <li class="nav-item nav-item-has-subnav">
                    <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 个人中心</a>
                    <ul class="nav nav-subnav">
                        <li> <a href="javascript:;" sec:authorize="isAuthenticated()"  onclick="goUserCenter()"> <span id="userName" style="display: none" sec:authentication="name"></span>  个人信息</a> </li>
                        <li> <a href="javascript:;" sec:authorize="!isAuthenticated()"  onclick="goLogin()" > 个人信息</a> </li>

                        <li> <a href="#">修改密码</a> </li>
                    </ul>
                </li>
                <li class="nav-item nav-item-has-subnav">
                    <a href="javascript:void(0)"><i class="iconfont icon-settingsBlock"></i> 设置</a>
                    <ul class="nav nav-subnav">
                        <li> <a href="#">友情链接</a> </li>
<!--                        <li> <a href="lyear_js_sliders.html">主题</a> </li>-->
                    </ul>
                </li>
            </ul>
        </nav>

        <div class="sidebar-footer">
            <p class="copyright"> 2021.6.20 <a target="_blank" href="http://lyear.itshubao.com">newIdeas</a> lihua</p>
        </div>
    </div>

</aside>
<!--End 左侧导航-->

<!--头部信息-->
<header th:fragment="headNav" class="lyear-layout-header">

    <nav class="navbar navbar-default">
        <div class="topbar">

            <div class="topbar-left">
                <div class="lyear-aside-toggler">
                    <span class="lyear-toggler-bar"></span>
                    <span class="lyear-toggler-bar"></span>
                    <span class="lyear-toggler-bar"></span>
                </div>
                <span class="navbar-page-title"> 后台首页 </span>
            </div>

            <ul class="topbar-right">
                <li class="dropdown dropdown-profile">
                    <a href="javascript:void(0)" data-toggle="dropdown">

                        <span sec:authentication="name"></span>
                        <span>设置 <span class="caret"></span></span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-right">
<!--                        <li> <a href="#" th:if="${session.user}" th:onclick="'javascript:goUserCenter('+${session.user.username}+')'"><i class="mdi mdi-account"></i> 个人信息(空)</a> </li>-->
                        <li> <a href="javascript:;" sec:authorize="isAuthenticated()"  onclick="goUserCenter()"> <span id="userName" style="display: none" sec:authentication="name"></span> <i class="mdi mdi-account"></i> 个人信息</a> </li>
                        <li> <a href="javascript:;" sec:authorize="!isAuthenticated()"  onclick="goLogin()" ><i class="mdi mdi-account"></i> 个人信息</a> </li>

                        <script type="text/javascript">

                            //登录
                            function goLogin() {
                                window.location.href="/toLogin";
                            }
                            //个人中心
                            function goUserCenter(){
                                var userName = $("#userName").text()
                                // alert(userName)
                                layer.open({
                                    type : 2,
                                    title : '个人信息',
                                    anim : 2,
                                    area : [ '90%', '90%' ],
                                    maxmin : true,
                                    shadeClose: true,
                                    content : "/userCenter/"+userName //通过请求打开附件视图
                                });
                            }
                        </script>
<!--                        <li> <a href="lyear_pages_edit_pwd.html"><i class="mdi mdi-lock-outline"></i> 修改密码</a> </li>-->
<!--                        <li> <a href="javascript:void(0)"><i class="mdi mdi-delete"></i> 清空缓存</a></li>-->
                        <li class="divider"></li>
                        <li> <a href="/logout"><i class="mdi mdi-logout-variant"></i> 退出登录</a> </li>
                    </ul>
                </li>
                <!--切换主题配色-->
                <li class="dropdown dropdown-skin">
                    <span data-toggle="dropdown" class="icon-palette"><i class="mdi mdi-palette"></i></span>
                    <ul class="dropdown-menu dropdown-menu-right" data-stopPropagation="true">
                        <li class="drop-title"><p>主题</p></li>
                        <li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="site_theme" value="default" id="site_theme_1" checked>
                    <label for="site_theme_1"></label>
                  </span>
                            <span>
                    <input type="radio" name="site_theme" value="dark" id="site_theme_2">
                    <label for="site_theme_2"></label>
                  </span>
                            <span>
                    <input type="radio" name="site_theme" value="translucent" id="site_theme_3">
                    <label for="site_theme_3"></label>
                  </span>
                        </li>
                        <li class="drop-title"><p>LOGO</p></li>
                        <li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="logo_bg" value="default" id="logo_bg_1" checked>
                    <label for="logo_bg_1"></label>
                  </span>
                            <span>
                    <input type="radio" name="logo_bg" value="color_2" id="logo_bg_2">
                    <label for="logo_bg_2"></label>
                  </span>
                            <span>
                    <input type="radio" name="logo_bg" value="color_3" id="logo_bg_3">
                    <label for="logo_bg_3"></label>
                  </span>
                            <span>
                    <input type="radio" name="logo_bg" value="color_4" id="logo_bg_4">
                    <label for="logo_bg_4"></label>
                  </span>
                            <span>
                    <input type="radio" name="logo_bg" value="color_5" id="logo_bg_5">
                    <label for="logo_bg_5"></label>
                  </span>
                            <span>
                    <input type="radio" name="logo_bg" value="color_6" id="logo_bg_6">
                    <label for="logo_bg_6"></label>
                  </span>
                            <span>
                    <input type="radio" name="logo_bg" value="color_7" id="logo_bg_7">
                    <label for="logo_bg_7"></label>
                  </span>
                            <span>
                    <input type="radio" name="logo_bg" value="color_8" id="logo_bg_8">
                    <label for="logo_bg_8"></label>
                  </span>
                        </li>
                        <li class="drop-title"><p>头部</p></li>
                        <li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="header_bg" value="default" id="header_bg_1" checked>
                    <label for="header_bg_1"></label>
                  </span>
                            <span>
                    <input type="radio" name="header_bg" value="color_2" id="header_bg_2">
                    <label for="header_bg_2"></label>
                  </span>
                            <span>
                    <input type="radio" name="header_bg" value="color_3" id="header_bg_3">
                    <label for="header_bg_3"></label>
                  </span>
                            <span>
                    <input type="radio" name="header_bg" value="color_4" id="header_bg_4">
                    <label for="header_bg_4"></label>
                  </span>
                            <span>
                    <input type="radio" name="header_bg" value="color_5" id="header_bg_5">
                    <label for="header_bg_5"></label>
                  </span>
                            <span>
                    <input type="radio" name="header_bg" value="color_6" id="header_bg_6">
                    <label for="header_bg_6"></label>
                  </span>
                            <span>
                    <input type="radio" name="header_bg" value="color_7" id="header_bg_7">
                    <label for="header_bg_7"></label>
                  </span>
                            <span>
                    <input type="radio" name="header_bg" value="color_8" id="header_bg_8">
                    <label for="header_bg_8"></label>
                  </span>
                        </li>
                        <li class="drop-title"><p>侧边栏</p></li>
                        <li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="sidebar_bg" value="default" id="sidebar_bg_1" checked>
                    <label for="sidebar_bg_1"></label>
                  </span>
                            <span>
                    <input type="radio" name="sidebar_bg" value="color_2" id="sidebar_bg_2">
                    <label for="sidebar_bg_2"></label>
                  </span>
                            <span>
                    <input type="radio" name="sidebar_bg" value="color_3" id="sidebar_bg_3">
                    <label for="sidebar_bg_3"></label>
                  </span>
                            <span>
                    <input type="radio" name="sidebar_bg" value="color_4" id="sidebar_bg_4">
                    <label for="sidebar_bg_4"></label>
                  </span>
                            <span>
                    <input type="radio" name="sidebar_bg" value="color_5" id="sidebar_bg_5">
                    <label for="sidebar_bg_5"></label>
                  </span>
                            <span>
                    <input type="radio" name="sidebar_bg" value="color_6" id="sidebar_bg_6">
                    <label for="sidebar_bg_6"></label>
                  </span>
                            <span>
                    <input type="radio" name="sidebar_bg" value="color_7" id="sidebar_bg_7">
                    <label for="sidebar_bg_7"></label>
                  </span>
                            <span>
                    <input type="radio" name="sidebar_bg" value="color_8" id="sidebar_bg_8">
                    <label for="sidebar_bg_8"></label>
                  </span>
                        </li>
                    </ul>
                </li>
                <!--切换主题配色-->
            </ul>

        </div>
    </nav>

</header>
<!--End 头部信息-->


<!--分页-->
<div class="clearfix" th:fragment="pageAdminNav(pageInfo)">


    <ul class="pagination no-margin justify-content-center">
        <li th:if="${pageInfo.pages}!=0" class="page-item"><a class="page-link" href="#" th:text="'共'+ ${pageInfo.pages}+'页'"></a></li>
        <li th:if="${pageInfo.hasPreviousPage}" class="page-item"><a
                th:href="@{'?page='+${pageInfo.prePage}}" class="page-link"> <i
                class="fa fa-angle-left"></i>&nbsp;上一页
        </a></li>
        <th:block th:each="nav : ${pageInfo.navigatepageNums}">
            <li
                    th:class="${nav==pageInfo.pageNum} ? 'page-item active':'page-item'"><a
                    class="page-link" th:href="@{'?page='+${nav}}" th:text="${nav}"></a>
            </li>
        </th:block>
        <th:block th:if="${pageInfo.hasNextPage}">
            <li class="page-item"><a
                    th:href="@{'?page='+${pageInfo.nextPage}}" class="page-link">
                下一页&nbsp;<i class="fa fa-angle-right"></i>
            </a></li>
        </th:block>
    </ul>
</div>

</html>